import 'package:flutter/material.dart';
import 'package:ytbusiness/config/yt_theme.dart';
import 'package:ytbusiness/utils/screen_adaptation.dart';
import 'package:ytbusiness/widgets/widgets.dart';


//账号与安全
class AccountAndSecurity extends StatefulWidget {
  @override
  _AccountAndSecurityState createState() => _AccountAndSecurityState();
}

class _AccountAndSecurityState extends State<AccountAndSecurity> {
  @override
  Widget build(BuildContext context) {
    return  Scaffold(
      appBar: customAppBar(context,title:"账号与安全"),
      body: Container(
        color: Colors.white,
        child: ListView(
          children: [
            InkWell(
              onTap: () {
                print('微信点击事件!!!!!');
                showDialog(
                  context: context,
                  builder: (BuildContext context) {
                    return AlertDialog(
                      contentPadding: EdgeInsets.only(left: 0, right: 0),
                      shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(setWidth(10),),
                      ),
                      title: Text(
                        '提示',
                        textAlign: TextAlign.left,
                        style: TextStyle(
                          color: Color(0xff323232),
                          fontSize: setSp(16),
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      content: Container(
                        padding: EdgeInsets.only(
                          left: setWidth(25),
                          top: setWidth(15),
                          right: setWidth(25),
                          bottom: setWidth(20),
                        ),
                        child: Column(
                          mainAxisSize: MainAxisSize.min,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            Text(
                              "要解除与微信账号的绑定吗",
                              style: TextStyle(
                                height: 1.4,
                                fontSize: setSp(14),
                                color: Color(0xff323232),
                              ),
                            ),
                            SizedBox(
                              height: setWidth(25),
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.end,
                              children: [
                                InkWell(
                                  onTap: () {
                                    print('取消 按钮点击事件!!!');
                                    Navigator.pop(context);
                                  },
                                  child: Container(
                                    height: setWidth(30),
                                    width: setWidth(60),
                                    alignment: Alignment.center,
                                    child: Text(
                                      '取消',
                                      style: TextStyle(
                                        color: YTTheme.theme,
                                        fontSize: setSp(15),
                                      ),
                                    ),
                                  ),
                                ),
                                InkWell(
                                  onTap: () {
                                    print('确定 按钮点击事件!!!');
                                    Navigator.pop(context);
                                  },
                                  child: Container(
                                    height: setWidth(30),
                                    width: setWidth(60),
                                    alignment: Alignment.center,
                                    child: Text(
                                      '确定',
                                      style: TextStyle(
                                        color: YTTheme.theme,
                                        fontSize: setSp(15),
                                      ),
                                    ),
                                  ),
                                ),
                              ],
                            )
                          ],
                        ),
                      ),
                    );
                  },
                );
              },
              child: Container(
                height: setWidth(60),
                margin: EdgeInsets.symmetric(horizontal: setWidth(15)),
                decoration: BoxDecoration(
                  color: Colors.white,
                  border: Border(
                    bottom: BorderSide(
                      width: setWidth(0.5),
                      color: Color(0xfff0f0f0),
                    ),
                  ),
                ),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Row(
                      children: [
                        Image.asset(
                          'assets/images/weChat_image.png',
                          width: setWidth(24),
                          height: setWidth(19.5),
                          fit: BoxFit.fill,
                        ),
                        SizedBox(
                          width: setWidth(4),
                        ),
                        Text(
                          '微信',
                          style: TextStyle(
                            color: Color(0xff323232),
                            fontSize: setSp(15),
                          ),
                        ),
                      ],
                    ),
                    Row(
                      children: [
                        Text(
                          '发呆业务爱好者',
                          style: TextStyle(
                            color: Color(0xff989898),
                            fontSize: setSp(15),
                          ),
                        ),
                        SizedBox(
                          width: setWidth(4),
                        ),
                        Image.asset(
                          'assets/images/right_go.png',
                          width: setWidth(9),
                          height: setWidth(16.5),
                          fit: BoxFit.fill,
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
